import QtQuick 1.0

import "/usr/share/libsocmdc/kdeadmouseutils-build-desktop"


ShellInvoker {
  property int vol
  //property double volToSet
  property int maxVol
  onFinished : {
    console.log('finished quitting');
    Qt.quit();
  }
  
  onOutputLineChanged : {
      if(outputLine.indexOf('volume')==-1){return;}
      console.log('##>: ' + outputLine);
      if(outputLine.indexOf('volume steps')>-1){
	var smV = outputLine.split(' ')[2];
	maxVol=smV;
	console.log('maxVol:'+smV);
	
      }else if(outputLine.indexOf('volume: 0')>-1){
	var arr = outputLine.split(' ');
	var lM = arr[arr.length-1];
	
	console.log('vol:'+vol);
      }
      
  }
  
  Component.onCompleted:{
    shellWholeAction('pacmd list-sinks');
    //shellAction('pacmd',['list-sinks','|','grep','volume']);
    //pacmd set-sink-volume 0 15537
  }
  

  
}
